package com.tfswx.jcyw.dmzc.window;

import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.wm.ToolWindow;
import com.intellij.openapi.wm.ToolWindowFactory;
import com.intellij.ui.content.Content;
import com.intellij.ui.content.ContentFactory;
import com.intellij.ui.content.ContentFactory.SERVICE;
import com.intellij.ui.content.ContentManager;
import org.jetbrains.annotations.NotNull;

public final class MyToolWindowFactory implements ToolWindowFactory {
    @Override
    public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
        ContentManager contentManager = toolWindow.getContentManager();
        ContentFactory contentFactory = SERVICE.getInstance();


        DmzcjlQueryWindow dmzcjlQueryWindow = ServiceManager.getService(project, DmzcjlQueryWindow.class);
        Content dmzcContent = contentFactory.createContent(dmzcjlQueryWindow.getComponent(), "走查记录", false);
        contentManager.addContent(dmzcContent);

        DmpsjlQueryWindow dmpsjlQueryWindow = ServiceManager.getService(project, DmpsjlQueryWindow.class);
        Content dmpsContent = contentFactory.createContent(dmpsjlQueryWindow.getComponent(), "评审记录", true);
        contentManager.addContent(dmpsContent);

    }
}
